package com.icart.entities;

import javax.persistence.*;

@Entity
@Table(name = "bi_servitemprice", schema = "ams", catalog = "")
@IdClass(BiServitempriceEntityPK.class)
public class BiServitempriceEntity {
    private long servitemid;
    private long carkindid;
    private Integer unitprice;
    private Integer whcost;
    private Integer whcount;
    private Integer whprice;

    @Id
    @Column(name = "servitemid")
    public long getServitemid() {
        return servitemid;
    }

    public void setServitemid(long servitemid) {
        this.servitemid = servitemid;
    }

    @Id
    @Column(name = "carkindid")
    public long getCarkindid() {
        return carkindid;
    }

    public void setCarkindid(long carkindid) {
        this.carkindid = carkindid;
    }

    @Basic
    @Column(name = "unitprice")
    public Integer getUnitprice() {
        return unitprice;
    }

    public void setUnitprice(Integer unitprice) {
        this.unitprice = unitprice;
    }

    @Basic
    @Column(name = "whcost")
    public Integer getWhcost() {
        return whcost;
    }

    public void setWhcost(Integer whcost) {
        this.whcost = whcost;
    }

    @Basic
    @Column(name = "whcount")
    public Integer getWhcount() {
        return whcount;
    }

    public void setWhcount(Integer whcount) {
        this.whcount = whcount;
    }

    @Basic
    @Column(name = "whprice")
    public Integer getWhprice() {
        return whprice;
    }

    public void setWhprice(Integer whprice) {
        this.whprice = whprice;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BiServitempriceEntity that = (BiServitempriceEntity) o;

        if (servitemid != that.servitemid) return false;
        if (carkindid != that.carkindid) return false;
        if (unitprice != null ? !unitprice.equals(that.unitprice) : that.unitprice != null) return false;
        if (whcost != null ? !whcost.equals(that.whcost) : that.whcost != null) return false;
        if (whcount != null ? !whcount.equals(that.whcount) : that.whcount != null) return false;
        if (whprice != null ? !whprice.equals(that.whprice) : that.whprice != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (servitemid ^ (servitemid >>> 32));
        result = 31 * result + (int) (carkindid ^ (carkindid >>> 32));
        result = 31 * result + (unitprice != null ? unitprice.hashCode() : 0);
        result = 31 * result + (whcost != null ? whcost.hashCode() : 0);
        result = 31 * result + (whcount != null ? whcount.hashCode() : 0);
        result = 31 * result + (whprice != null ? whprice.hashCode() : 0);
        return result;
    }
}
